/** 
 *  @file
 *  @brief   T2形（T2）梁截面属性使用解析公式计算类
 *  @author  duweixing
 *  @date    2024.04.17
 *  @version v1.0
 *  @par Copyright(c):  ShenGong  Simulation corporation
 */

#include "T2SectionFormulaCalculator.h"
#include "DataStructure/Common/Real.h"
#include "TSectionFormulaCalculator.h"

using SG::DataStructure::Common::Real;
using SG::DataStructure::FEM::PBARLData;
using SG::DataStructure::FEM::PBARData;
using SG::FEMSolver::Element::TSectionFormulaCalculator;
using SG::FEMSolver::Element::T2SectionFormulaCalculator;

void T2SectionFormulaCalculator::Compute
(
const SG::DataStructure::FEM::PBARLData& section,
_OUT SG::DataStructure::FEM::PBARData&   property,
_OUT SG::Algebra::Point&                 centroid
) const
{
    // NASTRAN 的 T2 形梁截面可视为 T 形梁截面绕剪心旋转180度，在同一剪心坐标系下截面属性保持不变，仅形心变成对称点，应力恢复点因标定位置改变需重新设置。详细请参考 NASTRAN 手册。
    TSectionFormulaCalculator TCalculator;
    TCalculator.Compute (section, _OUT property, _OUT centroid);
    // Real yC = yC;
    property.SetStressPoints ({-property.m_E1,  0.5 * section.m_dimension.at(3),
                               -property.m_C1,  property.m_D2,
                               -property.m_C1, -property.m_D2,
                               -property.m_E1, -0.5 * section.m_dimension.at(3)});
}